package com.itheima.d4_jdk8_time;

import java.time.Instant;

public class Test4_Instant {
    public static void main(String[] args) {
        //创建instant对象，获取当前时间
        Instant instant = Instant.now();
        System.out.println(instant);
        //获取instant对象对应的毫秒值
        long l = instant.toEpochMilli();
        System.out.println(l);

        int nano = instant.getNano();
        System.out.println(nano);

        //instant对象的作用
        Instant now = Instant.now();
        System.out.println(now);

        //获取instant对象对应的毫秒值
        long l1 = now.toEpochMilli();
        System.out.println(l1);
    }
}
